<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/ui/common/footer.xsl"/>
<xsl:variable name="host"><xsl:value-of select="document('/host.xml')//configuration/host"/></xsl:variable>
<xsl:variable name="tmp"><xsl:value-of select="document('/const.xml')//const/node[1]/@id"/></xsl:variable>
<xsl:variable name="gender"><xsl:value-of select="number(concat('0',dataset/@gender))"/></xsl:variable>
<xsl:variable name="beginage"><xsl:value-of select="number(concat('0',dataset/@beginage))"/></xsl:variable>
<xsl:variable name="endage"><xsl:value-of select="number(concat('0',dataset/@endage))"/></xsl:variable>
<xsl:variable name="province"><xsl:value-of select="number(concat('0',dataset/@province))"/></xsl:variable>
<xsl:variable name="city"><xsl:value-of select="number(concat('0',dataset/@city))"/></xsl:variable>
<xsl:variable name="oprovince"><xsl:value-of select="number(concat('0',dataset/@oprovince))"/></xsl:variable>
<xsl:variable name="ocity"><xsl:value-of select="number(concat('0',dataset/@ocity))"/></xsl:variable>
<xsl:variable name="people"><xsl:value-of select="number(concat('0',dataset/@people))"/></xsl:variable>
<xsl:variable name="blood"><xsl:value-of select="number(concat('0',dataset/@blood))"/></xsl:variable>
<xsl:variable name="marital"><xsl:value-of select="number(concat('0',dataset/@marital))"/></xsl:variable>
<xsl:variable name="smoke"><xsl:value-of select="number(concat('0',dataset/@smoke))"/></xsl:variable>
<xsl:variable name="drink"><xsl:value-of select="number(concat('0',dataset/@drink))"/></xsl:variable>
<xsl:variable name="industry"><xsl:value-of select="number(concat('0',dataset/@industry))"/></xsl:variable>
<xsl:variable name="occupation"><xsl:value-of select="number(concat('0',dataset/@occupation))"/></xsl:variable>
<xsl:variable name="knowledge"><xsl:value-of select="number(concat('0',dataset/@knowledge))"/></xsl:variable>
<xsl:variable name="character"><xsl:value-of select="dataset/@character"/></xsl:variable>
<xsl:variable name="hobby"><xsl:value-of select="dataset/@hobby"/></xsl:variable>
<xsl:variable name="page"><xsl:value-of select="dataset/@page"/></xsl:variable>
<xsl:variable name="size"><xsl:value-of select="dataset/@size"/></xsl:variable>
<xsl:variable name="url">blogger.aspx?gender=<xsl:value-of select="$gender" />&amp;beginage=<xsl:value-of select="$beginage" />&amp;endage=<xsl:value-of select="$endage" />&amp;province=<xsl:value-of select="$province" />&amp;city=<xsl:value-of select="$city" />&amp;people=<xsl:value-of select="$people" />&amp;blood=<xsl:value-of select="$blood" />&amp;marital=<xsl:value-of select="$marital" />&amp;smoke=<xsl:value-of select="$smoke" />&amp;drink=<xsl:value-of select="$drink" />&amp;industry=<xsl:value-of select="$industry" />&amp;occupation=<xsl:value-of select="$occupation" />&amp;knowledge=<xsl:value-of select="$knowledge" />&amp;character=<xsl:value-of select="$character" />&amp;hobby=<xsl:value-of select="$hobby" />&amp;size=<xsl:value-of select="$size" />&amp;page=</xsl:variable>
<xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" doctype-public="-//W3C//DTD XHTML 1.1//EN" indent="yes" encoding="utf-8" />
<xsl:template match="/dataset">
	<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
			<title>寻朋觅友 - <xsl:value-of select="document('/host.xml')//configuration/name" /></title>
			<link rel="icon" type="image/x-icon" href="/favicon.ico" />
			<link rel="stylesheet" type="text/css" href="/ui/blogger.css" />
			<script type="text/javascript" src="/js/lib.js"></script>
			<xsl:call-template name="script" />
		</head>
		<body>
			<div class="syblog_main_frame">
				<div class="syblog_head">
					<div class="syblog_logo">
						<img src="/ui/img/logo.jpg" />
					</div>
					<div class="syblog_ctrl_contain">
						<div class="syblog_ctrl_bar">
							<div class="syblog_login">
								<div>
									<form id="syblog_login_form" action="/login.aspx" onsubmit="return false">
										<span>用户名：</span><input name="account" style="ime-mode:disabled" dataType="Account" min="3" max="32" msg="您输入的用户名不正确" type="text" size="16" maxlength="20" />
										<span>密码：</span><input name="pwd" min="5" max="32" msg="您输入的密码不正确" type="password" size="16" />
										<input type="checkbox" name="autologin" id="autologin" /><label for="autologin">自动登录</label>
										<input type="image" src="/ui/img/login.gif" onclick="userlogin(this.form)" />
										<a href="/register.xml" target="register">注册</a>
										<a href="/forgetpwd.xml" target="forgetpwd">找回密码</a>
									</form>
								</div>
								<div id="syblog_login_show">
									<xsl:apply-templates select="document('/checklogin.aspx')//message" />
								</div>
							</div>
							<div class="syblog_bookmark">
								<a href="/help.xml">帮助</a>
							</div>
						</div>
						<div class="syblog_link">
							<ul>
								<li><a href="/">首页</a></li>
								<li><a href="http://www.muchool.com">码库</a></li>
								<li><a href="http://bbs.muchool.com">论坛</a></li>
								<li><a href="http://club.muchool.com">俱乐部</a></li>
							</ul>
							<span></span>
						</div>
						<div class="syblog_search">
							<form class="syblog_search_form" target="_self" action="/search.aspx" method="GET" onsubmit="return (this.elements['wd'].value.trim().length > 0)">
								<input tyte="text" name="wd" size="45" onkeypress="if(event.keyCode == 13 &amp;&amp; this.value.trim().length > 0)this.form.submit()" />
								<input type="submit" value="搜索" />
							</form>
						</div>
					</div>
				</div>
				<div class="syblog_blogger_search">
					<form id="syblog_blogger_search" method="get" action="blogger.aspx">
						<div>
							<div class="blogger_blogger_search_title">性别：</div>
							<div class="blogger_blogger_search_body">
								<input type="radio" name="gender" value="0" id="gender0">
									<xsl:if test="$gender=0">
										<xsl:attribute name="checked">-1</xsl:attribute>
									</xsl:if>
								</input><label for="gender0">不限</label>
								<xsl:call-template name="simpleradio">
									<xsl:with-param name="class">gender</xsl:with-param>
									<xsl:with-param name="checkeditem">
										<xsl:value-of select="$gender" />
									</xsl:with-param>
								</xsl:call-template>
							</div>
							<div class="blogger_blogger_search_title">现居地：</div>
							<div class="blogger_blogger_search_body">
								<select name="province" onchange="selectProvince(this,'city')">
									<option value="0">
										<xsl:if test="$province=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
										<xsl:text>不限省</xsl:text>
									</option>
									<xsl:call-template name="simplelist">
										<xsl:with-param name="class">province</xsl:with-param>
										<xsl:with-param name="selecteditem">
											<xsl:value-of select="$province" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
								<select name="city">
									<option value="0">
										<xsl:if test="$city=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
										<xsl:text>不限城市</xsl:text>
									</option>
									<xsl:if test="$province>0">
										<xsl:call-template name="unitlist">
											<xsl:with-param name="class">province</xsl:with-param>
											<xsl:with-param name="selectedparent">
												<xsl:value-of select="$province" />
											</xsl:with-param>
											<xsl:with-param name="selecteditem">
												<xsl:value-of select="$city" />
											</xsl:with-param>
										</xsl:call-template>
									</xsl:if>
								</select>
							</div>
						</div>
						<div style="clear:both">
							<div class="blogger_blogger_search_title">年龄：</div>
							<div class="blogger_blogger_search_body">
								<select name="beginage" onchange="selectAge(this)">
									<option value="0">
									  	<xsl:if test="$beginage=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
									  	<xsl:text>不限</xsl:text>
									</option>
									<xsl:call-template name="agelist">
										<xsl:with-param name="age">1</xsl:with-param>
										<xsl:with-param name="selectedage">
											<xsl:value-of select="$beginage" />
										</xsl:with-param>
									</xsl:call-template>
								</select>-<select name="endage">
									<option value="0">
									  	<xsl:if test="number($endage)=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
									  	<xsl:text>不限</xsl:text>
									</option>
									<xsl:call-template name="agelist">
										<xsl:with-param name="age">1</xsl:with-param>
										<xsl:with-param name="selectedage">
											<xsl:value-of select="$endage" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
							</div>
							<div class="blogger_blogger_search_title">出生地：</div>
							<div class="blogger_blogger_search_body">
								<select name="oprovince" onchange="selectProvince(this,'ocity')">
									<option value="0">
										<xsl:if test="$oprovince=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
										<xsl:text>不限省</xsl:text>
									</option>
									<xsl:call-template name="simplelist">
										<xsl:with-param name="class">province</xsl:with-param>
										<xsl:with-param name="selecteditem">
											<xsl:value-of select="$oprovince" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
								<select name="ocity">
									<option value="0">
										<xsl:if test="$ocity=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
										<xsl:text>不限城市</xsl:text>
									</option>
									<xsl:if test="$oprovince>0">
										<xsl:call-template name="unitlist">
											<xsl:with-param name="class">province</xsl:with-param>
											<xsl:with-param name="selectedparent">
												<xsl:value-of select="$oprovince" />
											</xsl:with-param>
											<xsl:with-param name="selecteditem">
												<xsl:value-of select="$ocity" />
											</xsl:with-param>
										</xsl:call-template>
									</xsl:if>
								</select>
							</div>
						</div>
						<div style="clear:both" align="center">
							<hr size="1"/>
						</div>
						<div>
							<div class="blogger_blogger_search_title">学历：</div>
							<div class="blogger_blogger_search_body">
								<select name="knowledge" style="width:105px">
									<option value="0">
									  	<xsl:if test="$knowledge=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
									  	<xsl:text>不限</xsl:text>
									</option>
									<xsl:call-template name="simplelist">
										<xsl:with-param name="class">knowledge</xsl:with-param>
										<xsl:with-param name="selecteditem">
											<xsl:value-of select="$knowledge" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
							</div>
							<div class="blogger_blogger_search_title">职业：</div>
							<div class="blogger_blogger_search_body">
								<select name="industry" onchange="selectIndustry(this)">
									<option value="0">
										<xsl:if test="$industry=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
										<xsl:text>不限</xsl:text>
									</option>
									<xsl:call-template name="simplelist">
										<xsl:with-param name="class">industry</xsl:with-param>
										<xsl:with-param name="selecteditem">
											<xsl:value-of select="$industry" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
								<select name="occupation">
									<option value="0">
										<xsl:if test="$occupation=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
										<xsl:text>不限</xsl:text>
									</option>
									<xsl:if test="$industry>0">
										<xsl:call-template name="unitlist">
											<xsl:with-param name="class">industry</xsl:with-param>
											<xsl:with-param name="selectedparent">
												<xsl:value-of select="$industry" />
											</xsl:with-param>
											<xsl:with-param name="selecteditem">
												<xsl:value-of select="$occupation" />
											</xsl:with-param>
										</xsl:call-template>
									</xsl:if>
								</select>
							</div>
						</div>
						<div style="clear:both">
							<div class="blogger_blogger_search_title">是否抽烟：</div>
							<div class="blogger_blogger_search_body">
								<select name="smoke">
									<option value="0">
									  	<xsl:if test="$smoke=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
									  	<xsl:text>不限</xsl:text>
									</option>
									<xsl:call-template name="simplelist">
										<xsl:with-param name="class">smoke</xsl:with-param>
										<xsl:with-param name="selecteditem">
											<xsl:value-of select="$smoke" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
							</div>
							<div class="blogger_blogger_search_title">是否饮酒：</div>
							<div class="blogger_blogger_search_body">
								<select name="drink">
									<option value="0">
									  	<xsl:if test="$drink=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
									  	<xsl:text>不限</xsl:text>
									</option>
									<xsl:call-template name="simplelist">
										<xsl:with-param name="class">drink</xsl:with-param>
										<xsl:with-param name="selecteditem">
											<xsl:value-of select="$drink" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
							</div>
						</div>
						<div style="clear:both">
							<div class="blogger_blogger_search_title">婚姻状况：</div>
							<div class="blogger_blogger_search_body">
								<input type="radio" name="marital" value="0" id="blood0">
									<xsl:if test="$marital=0">
										<xsl:attribute name="checked">-1</xsl:attribute>
									</xsl:if>
								</input><label for="marital0">不限</label>
								<xsl:call-template name="simpleradio">
									<xsl:with-param name="class">marital</xsl:with-param>
									<xsl:with-param name="checkeditem">
										<xsl:value-of select="$marital" />
									</xsl:with-param>
								</xsl:call-template>
							</div>
							<div class="blogger_blogger_search_title">民族：</div>
							<div class="blogger_blogger_search_body" style="width:auto">
								<select name="people">
									<option value="0">
									  	<xsl:if test="$people=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
									  	<xsl:text>不限</xsl:text>
									</option>
									<xsl:call-template name="simplelist">
										<xsl:with-param name="class">people</xsl:with-param>
										<xsl:with-param name="selecteditem">
											<xsl:value-of select="$people" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
							</div>
							<div class="blogger_blogger_search_title">血型：</div>
							<div class="blogger_blogger_search_body" style="width:auto">
								<select name="blood">
									<option value="0">
									  	<xsl:if test="$blood=0">
											<xsl:attribute name="selected">-1</xsl:attribute>
										</xsl:if>
									  	<xsl:text>不限</xsl:text>
									</option>
									<xsl:call-template name="simplelist">
										<xsl:with-param name="class">blood</xsl:with-param>
										<xsl:with-param name="selecteditem">
											<xsl:value-of select="$blood" />
										</xsl:with-param>
									</xsl:call-template>
								</select>
							</div>
						</div>
						<div style="clear:both" align="center">
							<hr size="1"/>
						</div>
						<div>
							<div class="blogger_blogger_search_title">性格特征：</div>
							<div class="blogger_blogger_search_body">
								<div>
									<xsl:call-template name="multibox">
										<xsl:with-param name="class">character</xsl:with-param>
										<xsl:with-param name="checkeditems">,<xsl:value-of select="$character" />,</xsl:with-param>
									</xsl:call-template>
								</div>
							</div>
						</div>
						<div style="clear:both" align="center">
							<hr size="1"/>
						</div>
						<div>
							<div class="blogger_blogger_search_title">兴趣爱好：</div>
							<div class="blogger_blogger_search_body">
								<div>
									<xsl:call-template name="multibox">
										<xsl:with-param name="class">hobby</xsl:with-param>
										<xsl:with-param name="checkeditems">,<xsl:value-of select="$hobby" />,</xsl:with-param>
									</xsl:call-template>
								</div>
							</div>
						</div>
						<div style="clear:both" align="center">
							<hr size="1"/>
						</div>
						<div style="clear:both" align="center"><input type="submit" value="找朋友" /></div>
					</form>
				</div>
				<div class="syblog_main_middle">
					<div class="syblog_main_middle_title">
						共找到<span><xsl:value-of select="format-number(table/row/c,'###,###,##0')"/></span>个朋友
					</div>
					<div class="syblog_main_middle_body">
						<xsl:apply-templates select="table[1]/row" />
					</div>
					<div style="clear:both;border-bottom:1px solid #bbb"></div>
				</div>
				<xsl:if test="number(table[2]/row/c)>number($size)">
					<div class="syblog_pager">
						<xsl:call-template name="pager">
							<xsl:with-param name="p">
								<xsl:value-of select="ceiling(number(table[2]/row/c) div number($size))"/>
							</xsl:with-param>
						</xsl:call-template>
					</div>
				</xsl:if>
				<xsl:call-template name="footer" />
			</div>
		</body>
		<script type="text/javascript">
		<![CDATA[
			checklogin();
		]]>
		</script>
	</html>
</xsl:template>
<xsl:template match="table[1]/row">
	<div class="syblog_main_blogger">
		<div class="syblog_main_blogger_photo">
			<img src="{photo}" border="0" />
		</div>
		<div class="syblog_main_blogger_content">
			<div>
				<a href="/{account}/info.xml" target="_blank"><span><xsl:value-of select="nickname"/></span></a>
				<xsl:text>：</xsl:text>
				<a href="/{account}" target="_blank"><xsl:value-of select="title"/></a>
			</div>
			<div>
				<span>性别：</span>
				<a href="blogger.aspx?gender={gender}" target="_blank">
					<xsl:call-template name="simpleitem">
						<xsl:with-param name="class">gender</xsl:with-param>
						<xsl:with-param name="item">
							<xsl:value-of select="number(gender)"/>
						</xsl:with-param>
					</xsl:call-template>
				</a>
			</div>
			<div>
				<span>年龄：</span>
				<xsl:choose>
					<xsl:when test="age &lt; 101">
						<a href="blogger.aspx?beginage={age}&amp;endage={age}"><xsl:value-of select="age"/>岁</a>
					</xsl:when>
					<xsl:otherwise>
						<span>未知</span>
					</xsl:otherwise>
				</xsl:choose>
			</div>
			<div>
				<span>居住地：</span>
				<a href="blogger.aspx?province={province}">
					<xsl:call-template name="simpleitem">
						<xsl:with-param name="class">province</xsl:with-param>
						<xsl:with-param name="item">
							<xsl:value-of select="number(province)"/>
						</xsl:with-param>
					</xsl:call-template>
				</a>
				<xsl:if test="number(province) &gt; 0">
					<xsl:text>&#160;-&#160;</xsl:text>
					<a href="blogger.aspx?province={province}&amp;city={city}">
						<xsl:call-template name="unititem">
							<xsl:with-param name="class">province</xsl:with-param>
							<xsl:with-param name="parent"><xsl:value-of select="number(province)" /></xsl:with-param>
							<xsl:with-param name="item">
								<xsl:value-of select="number(city)"/>
							</xsl:with-param>
						</xsl:call-template>
					</a>
				</xsl:if>
			</div>
			<div><p><xsl:value-of select="sub"/></p></div>
		</div>
		<div class="syblog_main_blogger_head">
			<div><img src="/{account}/head" width="60" height="60" border="0" /></div>
			<div><a href="/{account}" target="_blank">访问博客</a></div>
			<div><a class="gender{gender}" href="/{account}/info.xml" target="_blank">查看档案</a></div>
		</div>
	</div>
</xsl:template>
<xsl:template name="simpleitem">
	<xsl:param name="class" />
	<xsl:param name="item" />
	<xsl:value-of select="document('/const.xml')//const/node[@id=$class]/node[@id=$item]/@name" />
</xsl:template>
<xsl:template name="unititem">
	<xsl:param name="class" />
	<xsl:param name="parent" />
	<xsl:param name="item" />
	<xsl:value-of select="document('/const.xml')//const/node[@id=$class]/node[@id=$parent]/node[@id=$item]/@name" />
</xsl:template>
<xsl:template name="simplelist">
	<xsl:param name="class" />
	<xsl:param name="selecteditem" />
	<xsl:for-each select="document('/const.xml')//const/node[@id=$class]/node[position()>1]">
		<option value="{@id}">
			<xsl:if test="@id=$selecteditem">
				<xsl:attribute name="selected">-1</xsl:attribute>
			</xsl:if>
			<xsl:value-of select="@name" />
		</option>
	</xsl:for-each>
</xsl:template>
<xsl:template name="simpleradio">
	<xsl:param name="class" />
	<xsl:param name="checkeditem" />
	<xsl:for-each select="document('/const.xml')//const/node[@id=$class]/node[position()>1]">
		<input type="radio" name="{$class}" value="{@id}" id="{$class}{position()}">
			<xsl:if test="@id=$checkeditem">
				<xsl:attribute name="checked">-1</xsl:attribute>
			</xsl:if>
		</input><label for="{$class}{position()}"><xsl:value-of select="@name" /></label>
	</xsl:for-each>
</xsl:template>
<xsl:template name="unitlist">
	<xsl:param name="class" />
	<xsl:param name="selectedparent" />
	<xsl:param name="selecteditem" />
	<xsl:for-each select="document('/const.xml')//const/node[@id=$class]/node[@id=$selectedparent]/node[position()>1]">
		<option value="{@id}">
			<xsl:if test="@id=$selecteditem">
				<xsl:attribute name="selected">-1</xsl:attribute>
			</xsl:if>
			<xsl:value-of select="@name" />
		</option>
	</xsl:for-each>
</xsl:template>
<xsl:template name="agelist">
	<xsl:param name="age" />
	<xsl:param name="selectedage" />
	<option value="{$age}">
		<xsl:if test="$age=$selectedage">
			<xsl:attribute name="selected">-1</xsl:attribute>
		</xsl:if>
		<xsl:value-of select="$age" />
	</option>
	<xsl:if test="$age&lt;100">
		<xsl:call-template name="agelist">
			<xsl:with-param name="age">
				<xsl:value-of select="$age+1" />
			</xsl:with-param>
			<xsl:with-param name="selectedage">
				<xsl:value-of select="$selectedage" />
			</xsl:with-param>
		</xsl:call-template>
	</xsl:if>
</xsl:template>
<xsl:template name="multibox">
	<xsl:param name="class" />
	<xsl:param name="checkeditems" />
	<xsl:for-each select="document('/const.xml')//const/node[@id=$class]/node">
		<div>
			<input type="checkbox" name="{$class}" value="{@id}" id="{$class}{position()}">
				<xsl:if test="contains($checkeditems,concat(concat(',',@id),','))">
					<xsl:attribute name="checked">-1</xsl:attribute>
				</xsl:if>
			</input><label for="{$class}{position()}"><xsl:value-of select="@name" /></label>
		</div>
	</xsl:for-each>
</xsl:template>
<xsl:template match="/message">
	<div class="syblog_user_control">
		<xsl:choose>
			<xsl:when test="string-length(@account)>0">
				<span id="syblog_login_user"><xsl:value-of select="@name" />&#160;(<xsl:value-of select="@private" />/<xsl:value-of select="@system" />)</span><a id="syblog_manage_button" href="/{@account}/#/ui/common/manager.htm" target="_blank">管理</a>
				<script type="text/javascript">
					user.account="<xsl:value-of select="@account" />".toLowerCase();
					user.name="<xsl:call-template name="captureDoubleQuot"><xsl:with-param name="processText" select="@name" /></xsl:call-template>";
				</script>
			</xsl:when>
			<xsl:otherwise>
				<span id="syblog_login_user"></span><a id="syblog_manage_button" target="_blank">管理</a>
			</xsl:otherwise>
		</xsl:choose>
		<a href="#" onclick="logout();return false">注销</a>
	</div>
</xsl:template>
<xsl:template name="script">
	<script type="text/javascript">
		<![CDATA[
			var User = function() {
				this.account = "";
				this.name = "";
			};
			var user = new User();
			function userlogin(f) {
				$(f).post(function(r){
					var msg = r.getXML().documentElement;
					user.account = msg.getAttribute("account");
					user.name = msg.getAttribute("name");
					setLoginInfo(msg.getAttribute("private"),msg.getAttribute("system"));
				});
			}
			function checklogin() {
				if(user.account.length > 0) {
					$id("syblog_login_show").style.display = "block";
					$id("syblog_login_form").parentNode.style.display = "none";
				}
			}
			function setLoginInfo(p,s) {
				checklogin();
				$id("syblog_login_user").innerText = user.name + " (" + p + "/" + s + ") ";
				$id("syblog_manage_button").href = "/" + user.account + "#/ui/common/manager.htm";
			}
			function logout() {
				var xmlhttp = new HTTPRequest(true,true,false);
				xmlhttp.send("/login.aspx",null);
				$id("syblog_login_show").style.display = "none";
				$id("syblog_login_form").parentNode.style.display = "block";
			}
			Resources.load("/const.xml");
			function selectAge(age) {
				with(age.form.elements["endage"]) {
					options.length = 101 - age.selectedIndex;
					var j = 1;
					for(var i = age.selectedIndex + 1; i != 101;i++) {
						options[j].value = options[j++].text = i;
					}
				}
			}
			function selectProvince(p,to) {
				with(p.form.elements[to]) {
					selectedIndex = 0;
					if(p.selectedIndex > 0) {
						var citys = Resources.items["province"].items[p.value].items.getOwnPropertys();
						options.length = citys.length;
						for(var i = 1;i < citys.length;i++) {
							options[i].value = citys[i].id;
							options[i].text = citys[i].value;
						}
					} else {
						options.length = 1;
					}
				}
			}
			function selectIndustry(industry) {
				with(industry.form.elements['occupation']) {
					selectedIndex = 0;
					if(industry.selectedIndex > 0) {
						var occupations = Resources.items["industry"].items[industry.value].items.getOwnPropertys();
						options.length = occupations.length;
						for(var i = 1;i < occupations.length;i++) {
							options[i].value = occupations[i].id;
							options[i].text = occupations[i].value;
						}
					} else {
						options.length = 1;
					}
				}
			}
		]]>
	</script>
</xsl:template>
<xsl:template name="pager">
	<xsl:param name="p"/>
	<xsl:if test="$p>1">
		<xsl:if test="($page)>1">
			<a target="_self" href="{$url}{number($page)-1}">上一页</a>
		</xsl:if>
		<xsl:call-template name="loop">
			<xsl:with-param name="min">
				<xsl:choose>
					<xsl:when test="$p>10 and $page>5">
						<xsl:choose>
							<xsl:when test="$p>$page+5">
								<xsl:value-of select="number($page)-5"/>
							</xsl:when>
							<xsl:otherwise><xsl:value-of select="number($p)-10"/></xsl:otherwise>
						</xsl:choose>
					</xsl:when>
					<xsl:otherwise>1</xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
			<xsl:with-param name="max">
				<xsl:choose>
					<xsl:when test="$p>10">
						<xsl:choose>
							<xsl:when test="$p>$page+5">
								<xsl:choose>
									<xsl:when test="$page>5">
										<xsl:value-of select="number($page)+5"/>
									</xsl:when>
									<xsl:otherwise>10</xsl:otherwise>
								</xsl:choose>
							</xsl:when>
							<xsl:otherwise><xsl:value-of select="$p"/></xsl:otherwise>
						</xsl:choose>
					</xsl:when>
					<xsl:otherwise><xsl:value-of select="$p"/></xsl:otherwise>
				</xsl:choose>
			</xsl:with-param>
		</xsl:call-template>
		<xsl:if test="$p>number($page)">
			<a target="_self" href="{$url}{number($page)+1}">下一页</a>
		</xsl:if>
	</xsl:if>
</xsl:template>
<xsl:template name="loop">
	<xsl:param name="min"/>
	<xsl:param name="max"/>
	<xsl:if test="$max>=$min">
		<xsl:choose>
			<xsl:when test="$min=$page">
				<span>
					<xsl:value-of select="$min"/>
				</span>
			</xsl:when>
			<xsl:otherwise>
				<a target="_self" href="{$url}{$min}">[<xsl:value-of select="$min" />]</a>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:call-template name="loop">
			<xsl:with-param name="min">
				<xsl:value-of select="number($min)+1"/>
			</xsl:with-param>
			<xsl:with-param name="max">
				<xsl:value-of select="$max"/>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:if>
</xsl:template>
<xsl:template name="captureDoubleQuot">
	<xsl:param name="processText"/>
	<xsl:choose>
		<xsl:when test="contains($processText, '&quot;')">
			<xsl:value-of select="substring-before($processText,'&quot;')" />
			<xsl:text>\&amp;quot;</xsl:text>
			<xsl:call-template name="captureDoubleQuot">
				<xsl:with-param name="processText" select="substring-after($processText,'&quot;')"/>
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="$processText"/>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>
</xsl:stylesheet>